package com.tbit.uqbike.webmanager.business.maintain_performance.object.dto.stat;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.tbit.uqbike.annos.Excel;
import com.tbit.uqbike.webmanager.business.maintain_performance.constant.PerformanceExportField;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @author <a href="mailto:zheng.zebiao@tbit.com.cn">zb</a>
 * @since 2025/2/27
 */
@Data
public class DispatchPerformanceDetail {
    /**
     * 主键
     */
    private Long performanceId;

    /**
     * 调度记录id
     */
    private Integer dispatchLogId;

    /**
     * 绩效系数
     */
    @Excel(name = "绩效系数", sort = 16, conditionBit = PerformanceExportField.Dispatch.performance)
    private BigDecimal performance;

    /**
     * 绩效详情
     */
    @Excel(name = "绩效详情", sort = 17, conditionBit = PerformanceExportField.Dispatch.performanceDetail)
    private String performanceDetail;

    /**
     * 备注
     */
    @Excel(name = "备注", sort = 18)
    private String remark;

    /**
     * 闲置时长(小时)
     */
    private Integer idleTime;

    /**
     * 闲置区间
     */
    @Excel(name = "闲置区间", sort = 6)
    private String idleRange;

    /**
     * 调度前状态
     */
    @Excel(name = "调度前状态", sort = 7, conditionBit = PerformanceExportField.Dispatch.beforeStatus)
    private String beforeStatus;

    /**
     * 调度后状态
     */
    @Excel(name = "调度后状态", sort = 8, conditionBit = PerformanceExportField.Dispatch.afterStatus)
    private String afterStatus;

    /**
     * 调度前车辆标签
     */
    @Excel(name = "车辆标签", sort = 9, conditionBit = PerformanceExportField.Dispatch.beforeTag)
    private String beforeTag;

    /**
     * 直线距离
     */
    @Excel(name = "调度直线距离(米)", sort = 10)
    private Integer straightDistance;

    /**
     * 轨迹距离
     */
    @Excel(name = "调度轨迹距离(米)", sort = 11)
    private Integer distance;

    /**
     * 调度归属时段
     * 1-00:00~06:00
     * 2-06:00~12:00
     * 3-12:00~18:00
     * 4-18:00~24:00
     */
    @Excel(name = "调度归属时段", sort = 12, readConverterExp = "1=00:00~06:00,2=06:00~12:00,3=12:00~18:00,4=18:00~24:00")
    private Integer dispatchInterval;

    /**
     * 调度首单时效(分钟)
     */
    @Excel(name = "调度首单时效(分钟)", sort = 13, conditionBit = PerformanceExportField.Dispatch.firstOrderDuration)
    private Integer firstOrderDuration;

    /**
     * 调度24小时订单数
     */
    @Excel(name = "调度24小时订单数", sort = 14, conditionBit = PerformanceExportField.Dispatch.afterValidOrder)
    private Integer afterValidOrder;

    /**
     * 区域id
     */
    private Integer accountId;

    /**
     * 分区id
     */
    private Integer regionId;

    /**
     * 运维人员id
     */
    private Integer accountUserId;

    /**
     * 调度时间
     */
    @Excel(name = "日期", sort = 1, dateFormat = "yyyy-MM-dd")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime dispatchTime;

    /**
     * 车辆编号
     */
    @Excel(name = "车辆编码", sort = 2)
    private String userCode;
    /**
     * 车辆类型
     * 0-电单车 1-自行车
     */
    @Excel(name = "车辆类型", sort = 3, readConverterExp = "0=电单车,1=自行车")
    private Integer machineType;
    /**
     * 运维人员姓名
     */
    @Excel(name = "运维人姓名", sort = 4)
    private String accountUserName;
    /**
     * 运维人员手机
     */
    @Excel(name = "运维人手机号", sort = 5)
    private String accountUserPhone;

    /**
     * 审核人id
     */
    private Integer auditorId;

    /**
     * 审核状态
     * 0-无效 1-有效 2-待审核
     */
    private Integer isValid;

    /**
     * 审核状态(excel导出用)
     */
    @JsonIgnore
    @JSONField(serialize = false)
    @Excel(name = "审核状态", sort = 15)
    private String auditStatus;
}
